package com.example.azheng.rxjavamvpdemo.mvp.model;


import com.example.azheng.rxjavamvpdemo.bean.BaseObjectBean;
import com.example.azheng.rxjavamvpdemo.bean.login.LoginBean;
import com.example.azheng.rxjavamvpdemo.bean.userInfo.UserInfo;
import com.example.azheng.rxjavamvpdemo.mvp.contract.LoginContract;
import com.example.azheng.rxjavamvpdemo.net.RetrofitClient;

import io.reactivex.Flowable;

/**
 * @author azheng
 * @date 2018/6/4.
 * GitHub：https://github.com/RookieExaminer
 * Email：wei.azheng@foxmail.com
 * Description：
 */
public class LoginModel implements LoginContract.Model {
    @Override
    public Flowable<BaseObjectBean<LoginBean>> login(String username, String password) {
        return RetrofitClient.getInstance().getApi().login(username, password);
    }

    @Override
    public Flowable<BaseObjectBean<UserInfo>> userInfo() {
        return RetrofitClient.getInstance().getApi().userInfo();
    }
}
